//
//  Team9discussTableViewCell.m
//  Team9Project
//
//  Created by dlios on 15/10/15.
//  Copyright © 2015年 apple. All rights reserved.
//

#import "Team9discussTableViewCell.h"
#import <Masonry.h>
@implementation Team9discussTableViewCell


- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createAllView];
    }

    return self;
}

- (void)createAllView{

    
    
    self.backView = [[Team9BaseView alloc] init];
    [self.contentView addSubview:self.backView];
//    self.backView.backgroundColor = [UIColor whiteColor];
    self.contentView.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1];
    
    
    self.picImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.picImageView];
    self.picImageView.backgroundColor = [UIColor clearColor];
    
    
    self.titleLabel = [[Team9BaseLabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    self.titleLabel.backgroundColor = [UIColor clearColor];
    self.titleLabel.font = [UIFont systemFontOfSize:15 / 375.0 * WIDTH];
    
    self.discussImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.discussImageView];
    self.discussImageView.backgroundColor = [UIColor clearColor];
    
    self.discussLabel = [[Team9BaseLabel alloc] init];
    [self.contentView addSubview:self.discussLabel];
    self.discussLabel.backgroundColor = [UIColor clearColor];
    self.discussLabel.font = [UIFont systemFontOfSize:10 / 375.0 * WIDTH];
    
    self.seeImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.seeImageView];
    self.seeImageView.backgroundColor =[UIColor clearColor];
    
    self.seeLabel = [[Team9BaseLabel alloc] init];
    [self.contentView addSubview:self.seeLabel];
    self.seeLabel.backgroundColor = [UIColor clearColor];
    self.seeLabel.font = [UIFont systemFontOfSize:10 / 375.0 * WIDTH];
    
    
    self.cutView = [[Team9BaseView alloc] initWithType:ViewTYpeLight];
    [self.contentView addSubview:self.cutView];

    
    self.headImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.headImageView];
    self.headImageView.layer.cornerRadius = 18 / 667.0 * HEGHT;
    self.headImageView.layer.masksToBounds = YES;
    
    self.discussLabel = [[Team9BaseLabel alloc] initWith:LableColorTypeBlackWhite];
    [self.contentView addSubview:self.discussLabel];
    self.discussLabel.font = [UIFont systemFontOfSize:10 / 375.0 * WIDTH];
    
    self.describeLabel = [[Team9BaseLabel alloc] initWith:LableColorTypeBlackWhite];
    [self.contentView addSubview:self.describeLabel];
    self.describeLabel.backgroundColor = [UIColor clearColor];
    self.describeLabel.font = [UIFont systemFontOfSize:13 / 375.0 * WIDTH];
    
    [self d_makeConstraints];
}



- (void)d_makeConstraints{

   [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
      make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(5 / 375.0 * WIDTH, 5 / 375.0 * WIDTH, 5 / 375.0 * WIDTH, 5 / 375.0 * WIDTH));
   }];
    
   [self.picImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       make.left.top.bottom.equalTo(self.backView);
       make.width.equalTo(self.backView.mas_width).multipliedBy(0.27);
       
   }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.picImageView.mas_right).offset(10 / 375.0 * WIDTH);
        make.top.equalTo(self.backView.mas_top).offset(10 / 375.0 * WIDTH);
        make.right.equalTo(self.backView.mas_right).offset(-10 / 375.0 * WIDTH);
        make.height.equalTo(self.backView.mas_height).multipliedBy(0.2);
        
    }];
    
    [self.discussImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.picImageView.mas_right).offset(10 / 375.0 * WIDTH);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(10 / 375.0 * WIDTH);
        make.height.equalTo(self.backView.mas_height).multipliedBy(0.13);
        make.width.equalTo(self.discussImageView.mas_height);
       
    }];
    
    [self.discussLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.discussImageView.mas_right).offset(3 / 375.0 * WIDTH);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(10 / 375.0 * WIDTH);
        make.height.equalTo(self.backView.mas_height).multipliedBy(0.13);
        make.width.equalTo(self.discussLabel.mas_height).multipliedBy(1.5);
        
    }];
    
    [self.seeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.discussLabel.mas_right).offset(10 / 375.0 * WIDTH);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(10 / 375.0 * WIDTH);
        make.height.equalTo(self.backView.mas_height).multipliedBy(0.13);
        make.width.equalTo(self.seeImageView.mas_height);
        
    }];
    
    [self.seeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.seeImageView.mas_right).offset(3 / 375.0 * WIDTH);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(10 / 375.0 * WIDTH);
        make.height.equalTo(self.backView.mas_height).multipliedBy(0.13 / 375.0 * WIDTH);
        make.width.equalTo(self.seeLabel.mas_height).multipliedBy(1.5);
        
    }];
    
    [self.cutView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.picImageView.mas_right).offset(10 / 375.0 * WIDTH);
        make.top.equalTo(self.seeLabel.mas_bottom).offset(10 / 375.0 * WIDTH);
        make.right.equalTo(self.contentView.mas_right).offset(-10 / 375.0 * WIDTH);
        make.height.mas_equalTo(1 / 375.0 * WIDTH);
    }];
    
    [self.headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.picImageView.mas_right).offset(10 / 375.0 * WIDTH);
        make.top.equalTo(self.cutView.mas_bottom).offset(5 / 375.0 * WIDTH);
        make.height.equalTo(self.backView.mas_height).multipliedBy(0.3);
        make.width.equalTo(self.headImageView.mas_height);
        
    }];
    
    [self.describeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headImageView.mas_right).offset(10 / 375.0 * WIDTH);
        make.top.equalTo(self.cutView.mas_bottom).offset(15 / 375.0 * WIDTH);
        make.right.equalTo(self.backView.mas_right).offset(-10 / 375.0 * WIDTH);
        make.height.equalTo(self.describeLabel.mas_width).multipliedBy(0.1);
    }];

    
    
}



- (void)layoutSubviews{
    [super layoutSubviews];
}

@end
